<%@page language="C#" CodeFile="DB.aspx.cs" Inherits="C" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

    <title> DB </title>
    <meta http-equiv="Content-Type" Content="text/html;charset=utf-8" />
    <meta name="Version" content="0.0.0.0" />
    <meta name="Copyright" content="ML" />
    <meta name="LastModify" content="2011-06-19" />
    <style type="text/css">
    	table,th,td{border:1px solid #000;}
    </style>
</head>
<body>

<%

// 连接字符串界面
if (!dbHandler.IsConnected){
%>
<h3>连接字符串</h3>
<form method="post" action="?">
    <textarea name="ConnectionString" rows="2" cols="70"></textarea>
    <input type="hidden" name="Op" value="connect" />
    <input type="submit" value="连接" />
</form>
<%
}
// 查询界面
else{
    string checkedSelect = string.Empty;
    string checkedExecute = string.Empty;
    if( null!=Session["checkedExecute"] && true==(bool)Session["checkedExecute"])
        checkedExecute = "checked='checked'";
    else
        checkedSelect  = "checked='checked'";

%>
<h3>查询SQL</h3>
<form method="post" action="?">
    <input type="hidden" name="Op" value="deconnect" />
    <span><input type="submit" value="断开连接" /></span>
    <span>连接字符串:<%=Session["ConnectionString"]%>
</form>
<form method="post" action="?">
    sql:
    <br/>
    <textarea name="sql" rows="7" cols="70"><%=Session["sql"]%></textarea>
    <br />
    输出格式:
    <br />
    <textarea name="formatString" rows="1" cols="70"><%=Session["formatString"]%></textarea>
    <input type="radio" name="Op" value="select" <%=checkedSelect %> />select
    <input type="radio" name="Op" value="execute" <%=checkedExecute %>/>execute
    <input type="submit" value="查询" />
</form>
<%
}
%>

<br /><br /><hr />
<asp:literal id="lblResult" runat="server"></asp:literal>
</body>
</html>





